<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Make Controller Kit - Firmware API: System</title>
<link href="mt_doxygen.css" rel="stylesheet" type="text/css" />
<link href="../resources/mt_doxytabs.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.header {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12pt;
	color: #222222;
}
-->
</style>
</head>

<body>
<table width="800" border="0">
    <tr>
      <td colspan="3">
        <form method="get" action="http://www.google.com/search">
          <div align="right">
            <input type="text"   name="q" size="25"
              maxlength="255" value="" />
            <input type="submit" value="Search" />
            <input type="hidden" name="sitesearch" value="makingthings.com/ref/firmware/html" />
          </div>
        </form>
       </td>
    </tr>
    <tr>
      <td><div align="center"><a href="http://www.makingthings.com">
				<img src="../resources/logo_brown_medium.png" alt="MakingThings"
									width="200" height="78" border="0" align="middle" longdesc="http://www.makingthings.com" /></a></div></td>
				<td><div align="center" class="header">
      		Make Controller Kit <br />
          Firmware API
      </div></td>
      <td><div align="center"><a href="http://www.makezine.com">
					<img src="../resources/make_logo.png" alt="MAKE Zine" 
										width="164" height="73" border="0" align="middle" longdesc="http://www.makezine.com" /></a></div></td>
    </tr>
</table>
</body>
</html>
<!-- Generated by Doxygen 1.5.4 -->
<script type="text/javascript">
<!--
function changeDisplayState (e){
  var num=this.id.replace(/[^[0-9]/g,'');
  var button=this.firstChild;
  var sectionDiv=document.getElementById('dynsection'+num);
  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
    sectionDiv.style.display='block';
    button.src='open.gif';
  }else{
    sectionDiv.style.display='none';
    button.src='closed.gif';
  }
}
function initDynSections(){
  var divs=document.getElementsByTagName('div');
  var sectionCounter=1;
  for(var i=0;i<divs.length-1;i++){
    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
      var header=divs[i];
      var section=divs[i+1];
      var button=header.firstChild;
      if (button!='IMG'){
        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
        button=document.createElement('img');
        divs[i].insertBefore(button,divs[i].firstChild);
      }
      header.style.cursor='pointer';
      header.onclick=changeDisplayState;
      header.id='dynheader'+sectionCounter;
      button.src='closed.gif';
      section.id='dynsection'+sectionCounter;
      section.style.display='none';
      section.style.marginLeft='14px';
      sectionCounter++;
    }
  }
}
window.onload = initDynSections;
-->
</script>
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="classes.html"><span>Data&nbsp;Structures</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<h1>System<br>
<small>
[<a class="el" href="group___controller.html">Controller</a>]</small>
</h1>The System subsystem monitors and controls several aspects of the system.  
<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___system.html#g1d44df5bbae21dd02c41910ae7ffd706">System_SetActive</a> (int state)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets whether the System subsystem is active.  <a href="#g1d44df5bbae21dd02c41910ae7ffd706"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___system.html#gf69f323f13e699e179290d1857ef2ef8">System_GetActive</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the active state of the subsystem.  <a href="#gf69f323f13e699e179290d1857ef2ef8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___system.html#g70856cdb0248591e1ddc44d1ca96e475">System_GetFreeMemory</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the free size of the heap.  <a href="#g70856cdb0248591e1ddc44d1ca96e475"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___system.html#g42dad93cdc36c55a34f225982a0ff753">System_GetSerialNumber</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Gets the board's Serial Number.  <a href="#g42dad93cdc36c55a34f225982a0ff753"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___system.html#g158e76fe4fcb24e3cce77d64c9e018ed">System_SetSerialNumber</a> (int serial)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the Serial Number.  <a href="#g158e76fe4fcb24e3cce77d64c9e018ed"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___system.html#g2c73f861f3856f1189f139d08835f8c1">System_SetSamba</a> (int sure)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the board to SAM-BA mode, erasing the flash memory.  <a href="#g2c73f861f3856f1189f139d08835f8c1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___system.html#gfba0e52d7c1b37ba36cf8172e005ffd1">System_SetName</a> (char *name)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Gives the board a name.  <a href="#gfba0e52d7c1b37ba36cf8172e005ffd1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___system.html#g1bcad57269385df99b23c8e9de3f81fc">System_GetName</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read the board's name.  <a href="#g1bcad57269385df99b23c8e9de3f81fc"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___system.html#g70fc8e90a5c3dd0a36f7c2b4fe0a8bfc">System_SetReset</a> (int sure)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Reset the board.  <a href="#g70fc8e90a5c3dd0a36f7c2b4fe0a8bfc"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The System subsystem monitors and controls several aspects of the system. 
<p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="gf69f323f13e699e179290d1857ef2ef8"></a><!-- doxytag: member="system.c::System_GetActive" ref="gf69f323f13e699e179290d1857ef2ef8" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int System_GetActive           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the active state of the subsystem. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The active state of the subsystem - 1 (active) or 0 (inactive). </dd></dl>

<p>Definition at line <a class="el" href="system_8c-source.html#l00096">96</a> of file <a class="el" href="system_8c-source.html">system.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="g70856cdb0248591e1ddc44d1ca96e475"></a><!-- doxytag: member="system.c::System_GetFreeMemory" ref="g70856cdb0248591e1ddc44d1ca96e475" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int System_GetFreeMemory           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the free size of the heap. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The size free memory. </dd></dl>

<p>Definition at line <a class="el" href="system_8c-source.html#l00105">105</a> of file <a class="el" href="system_8c-source.html">system.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="g1bcad57269385df99b23c8e9de3f81fc"></a><!-- doxytag: member="system.c::System_GetName" ref="g1bcad57269385df99b23c8e9de3f81fc" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* System_GetName           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Read the board's name. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The board's name as a string. </dd></dl>

<p>Definition at line <a class="el" href="system_8c-source.html#l00194">194</a> of file <a class="el" href="system_8c-source.html">system.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="g42dad93cdc36c55a34f225982a0ff753"></a><!-- doxytag: member="system.c::System_GetSerialNumber" ref="g42dad93cdc36c55a34f225982a0ff753" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int System_GetSerialNumber           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Gets the board's Serial Number. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>CONTROLLER_OK ( = 0 ). </dd></dl>

<p>Definition at line <a class="el" href="system_8c-source.html#l00114">114</a> of file <a class="el" href="system_8c-source.html">system.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="g1d44df5bbae21dd02c41910ae7ffd706"></a><!-- doxytag: member="system.c::System_SetActive" ref="g1d44df5bbae21dd02c41910ae7ffd706" args="(int state)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int System_SetActive           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>state</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets whether the System subsystem is active. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>state</em>&nbsp;</td><td>An integer specifying the state system </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Zero on success. </dd></dl>

<p>Definition at line <a class="el" href="system_8c-source.html#l00065">65</a> of file <a class="el" href="system_8c-source.html">system.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="gfba0e52d7c1b37ba36cf8172e005ffd1"></a><!-- doxytag: member="system.c::System_SetName" ref="gfba0e52d7c1b37ba36cf8172e005ffd1" args="(char *name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int System_SetName           </td>
          <td>(</td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>name</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Gives the board a name. 
<p>
The name must be alpha-numeric - only letters and numbers. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>A string specifying the board's name </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>CONTROLLER_OK if OK. </dd></dl>

<p>Definition at line <a class="el" href="system_8c-source.html#l00172">172</a> of file <a class="el" href="system_8c-source.html">system.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="g70fc8e90a5c3dd0a36f7c2b4fe0a8bfc"></a><!-- doxytag: member="system.c::System_SetReset" ref="g70fc8e90a5c3dd0a36f7c2b4fe0a8bfc" args="(int sure)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int System_SetReset           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>sure</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Reset the board. 
<p>
Will reboot the board if the parameter sure is true. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>sure</em>&nbsp;</td><td>confirms the request is true. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>CONTROLLER_OK if OK. </dd></dl>

<p>Definition at line <a class="el" href="system_8c-source.html#l00236">236</a> of file <a class="el" href="system_8c-source.html">system.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="g2c73f861f3856f1189f139d08835f8c1"></a><!-- doxytag: member="system.c::System_SetSamba" ref="g2c73f861f3856f1189f139d08835f8c1" args="(int sure)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int System_SetSamba           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>sure</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the board to SAM-BA mode, erasing the flash memory. 
<p>
Leaves the board in a non-deterministic state awaiting a power cycle or reset. <dl class="return" compact><dt><b>Returns:</b></dt><dd>CONTROLLER_OK if OK. </dd></dl>

<p>Definition at line <a class="el" href="system_8c-source.html#l00140">140</a> of file <a class="el" href="system_8c-source.html">system.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="g158e76fe4fcb24e3cce77d64c9e018ed"></a><!-- doxytag: member="system.c::System_SetSerialNumber" ref="g158e76fe4fcb24e3cce77d64c9e018ed" args="(int serial)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int System_SetSerialNumber           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>serial</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets the Serial Number. 
<p>
Note that this can be changed by the user at any time, but that it is used in the <a class="el" href="group___network.html">Network</a> subsystem to form the last two bytes of the network MAC address, so ideally units on the same network should have unique serial numbers. <dl class="return" compact><dt><b>Returns:</b></dt><dd>CONTROLLER_OK if OK. </dd></dl>

<p>Definition at line <a class="el" href="system_8c-source.html#l00129">129</a> of file <a class="el" href="system_8c-source.html">system.c</a>.</p>

</div>
</div><p>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Make Controller Kit</title>
<style type="text/css">
<!--
.footer {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9pt;
	color: #999999;
}
-->
</style>
</head>

<body>
<hr size="1">
<div>
  <p class="footer">The Make Controller Kit is an open source project maintained by <a href="http://www.makingthings.com">MakingThings</a>.<br />
    MakingThings code is released under the <a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">Apache 2.0 license</a>.<br />
    Bug tracker, development wiki and status can be found at <a href="http://dev.makingthings.com">http://dev.makingthings.com</a>.<br />
		This document was last updated on 5 Dec 2007.
</p>
</div>
<!-- Google Analytics Code -->
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-769030-1";
urchinTracker();
</script>
</body>
</html>
